let location = require("../../../../mybehaviors/location/location");

let app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  behaviors: [location],
  properties: {
    usClass:{
      type:Boolean,
      value:false
    },
    isImg:{
      type:Boolean,
      value:false
    },
    storeItem: {
      type:Object,
      value: {}
    },
    address:{
      type:String,
      value:''
    }
  },
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    navigation(event) {
      let latitude = event.currentTarget.dataset.latitude;
      let longitude = event.currentTarget.dataset.longitude;
      let storeName = event.currentTarget.dataset.storename;
      let point = app.BMapTransqqMap(parseFloat(longitude), parseFloat(latitude));
      wx.openLocation({
        latitude: point.lat,
        longitude: point.lng,
        name: storeName,
        scale: 18
      });
    },
    callStore(event) {
      let phone = event.currentTarget.dataset.phone
      wx.makePhoneCall({
        phoneNumber: phone
      });
    },
    storeNavigation(event) {
      let storeId = event.currentTarget.dataset.storeid;
      wx.navigateTo({
        url: '/packageF/consumption/commodity/commodity?storeId=' + storeId
      })
    }
    
  }
})
